package com.enhe.gck.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.enhe.gck.item.OrderHWANE16677Item;
import com.kuangkie.carbon.record.Updatable;
import com.kuangkie.carbon.record.annotation.Attribute;
import com.kuangkie.carbon.record.annotation.CarbonRecord;
import com.kuangkie.carbon.record.annotation.RecordCode;
import com.kuangkie.carbon.record.annotation.Relation;
import com.kuangkie.carbon.uid.model.UidManager;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import static com.enhe.gck.CarbonRelationType.*;

// 倒料订单
@Data
@CarbonRecord("hwane18490")
public class PouringOrder implements Updatable {
    @JSONField(name = "唯一编码")
    @RecordCode
    private Long id = UidManager.getLongUID();

    // 单号
    @JSONField(name = "单号")
    @Attribute("hwan18492")
    private String order;

    // IC卡号
    @JSONField(name = "IC卡号")
    @Attribute("hwan18493")
    private String icCard;

    // 状态
    @JSONField(name = "状态")
    @Attribute("hwan18494")
    private String state;

    // 重量
    @JSONField(name = "重量")
    @Attribute("hwan18495")
    private Double weight;

    // 名称
    @JSONField(name = "名称")
    @Attribute("hwan18496")
    private String name;

    // 订单来源
    @JSONField(name = "订单来源")
    @Attribute("hwan18511")
    private String orderSource;

    // 录入类型
    @JSONField(name = "录入类型")
    @Attribute("hwan18512")
    private String inputType;

    // 命令
    @JSONField(name = "命令")
    @Attribute("hwan18513")
    private String command;

    // 过磅1重量
    @JSONField(name = "过磅1重量")
    @Attribute("hwan18516")
    private Double weight1;

    // 过磅2重量
    @JSONField(name = "过磅2重量")
    @Attribute("hwan18517")
    private Double weight2;

    // 过磅1时间
    @JSONField(name = "过磅1时间")
    @Attribute("hwan18518")
    private LocalDateTime weight1Time;

    // 过磅2时间
    @JSONField(name = "过磅2时间")
    @Attribute("hwan18519")
    private LocalDateTime weight2Time;

    @JSONField(name="皮重")
    @Attribute("hwan19160")
    private BigDecimal weightTare;

    // 毛重
    @JSONField(name="毛重")
    @Attribute("hwan19161")
    private BigDecimal weightGross;

    @JSONField(name = "是否作废")
    @Attribute("hwan19296")
    private Boolean isCancel;

    @JSONField(name = "完成时间")
    @Attribute("hwan19297")
    private LocalDateTime finishTime;

    @JSONField(name="类型")
    @Attribute("hwan20686")
    private String type;
    @JSONField(name = "车皮重")
    @Attribute("hwan20679")
    private BigDecimal carWeightTare;
    @JSONField(name = "有效截至时间")
    @Attribute("hwan20680")
    private LocalDateTime effectiveDeadline;
    @JSONField(name = "皮重更新时间")
    @Attribute("hwan20726")
    private LocalDateTime weightTareTime;

    @JSONField(name="备注")
    @Attribute("hwan19654")
    private String remark;

    @Relation(RR_倒料订单_司机_司机管理)
    private Driver driver;
    @Relation(RR_倒料订单_车牌号_车辆管理)
    private Car car;
    @Relation(RR_倒料订单_品种信息_物料管理)
    private Material material;

    @Override
    public String getRecordCode() {
        return this.id == null ? null : this.id.toString();
    }
}